package it.ztd.bootbroadcastreceiver;

import android.content.ComponentName;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        findViewById(R.id.tv).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
//                startService(new Intent(MainActivity.this, MyService.class));
                ComponentName componentName = new ComponentName("cc.netpas.android_firewall", "net.netfits.android.netfits.home.HomeActivity");
                Intent intent = new Intent();

                // 通过Intent的setComponet指定组件名称

                intent.setComponent(componentName);

                // 启动Activity

                startActivity(intent);
            }
        });
    }
}
